import {lazy} from 'react'
const cart = lazy(()=>import('../page/cart'))
const cate = lazy(()=>import('../page/cate'))
const goodsDetail = lazy(()=>import('../page/goodsDetail'))
const goodslist = lazy(()=>import('../page/goodslist'))
const index = lazy(()=>import('../page/index'))
const login = lazy(()=>import('../page/login'))
const register = lazy(()=>import('../page/register'))
const uncenter = lazy(()=>import('../page/uncenter'))
const page404 = lazy(()=>import('../page/page404'))

const rules=[
    {
        path: "/",
        redirect: "/index",
        exact: true,
        requeireLogin:false
    },
    {
        path: "/index",
        component: index,
        exact: false,
        requeireLogin:false
    },
    {
        path: "/cart",
        component: cart,
        exact: false,
        requeireLogin:true
    },
    {
        path: "/cate",
        component: cate,
        exact: false,
        requeireLogin:false
    },
    {
        path: "/goodsDetail",
        component: goodsDetail,
        exact: false,
        requeireLogin:false
    },
    {
        path: "/goodslist",
        component: goodslist,
        exact: false,
        requeireLogin:false
    },
    {
        path: "/login",
        component: login,
        exact: false,
        requeireLogin:false
    },
    {
        path: "/register",
        component: register,
        exact: false,
        requeireLogin:false
    },
    {
        path: "/uncenter",
        component: uncenter,
        exact: false,
        requeireLogin:true
    },
    {
        path:'*',
        component: page404,
        exact: false,
        requeireLogin:false
    }
]

export default rules